package com.yuan.java.concurrency;

import org.junit.Test;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Mock implements Runnable {

    static Map<String, String> map = new HashMap<>();



    @Override
    public void run() {
        try {
            CountDown.countDownLatch.countDown();
            String a = HttpHelper.get("http://127.0.0.1:8080/AppCheckCardVip/nextItem?userId=910001545&processItem=REAL_NAME_AUTH&appliType=2&cardVipType=1");
            System.out.println(a);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
    @Test
    public void mainTest() throws Exception {
        Mock test = new Mock();
        long start = System.currentTimeMillis();
        for (int i = 0; i < CountDown.COUNT; i++) {
            test.run();
        }
        CountDown.countDownLatch.await();
        long end = System.currentTimeMillis();
        System.out.println((end - start)/1000.00);

    }


}  